<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"
	/>
	<meta name="format-detection" content="telephone=no,email=no,date=no,address=no" />
	<script src="/javascripts/jquery-3.3.1.min.js"></script>
	<script src="/javascripts/ydui.flexible.js"></script>
	<script src="/javascripts/ydui.js"></script>
	<script src="/javascripts/clipboard.min.js"></script>
	<script type="text/javascript" src="/layer/layer.js"></script>
	<link rel="stylesheet" type="text/css" href="/stylesheets/style.css" />
	<title>IOV 空投福利</title>
	<style>
	.cell-left{color: #FFF; font-weight: bold}
	</style>
</head>

<body>
    <div class="bottom_link2">
		
		<img src="/images/contBg3.png" />
		<div class="imgpo0">
			<img src="/images/logo.png" />
		</div>
		<h3>您已获得  30 IOV</h3>
		<h6>识别二维码添加微信群进行验证和领取</h6>
		<img class="imgpo" src="/images/qrcode.png" />
      </div>
	<section class="contentpadd">
			<div class="m-cell" style="background:none; color: #FFF">
					<div class="cell-item">
						<div class="cell-left">每邀请一人可获得10IOV，上不封顶</div>
					<div class="cell-right"></div>
					</div>
					<p style="display: block; font-size: 14px;margin: 10px 0 0 10px">我的邀请链接</p>
					<div class="cell-item">
						<!-- <p style="display: block">我的邀请链接</p> -->
						<div class="cell-left copylink" style="font-size: 12px" id="linksad">https://carlive.bugu.one/invite?inviteCode=<%=inviteCode%></div>
						<div class="cell-right"><a href="javascript:;" class="btn btn-primary copyBtn">复制</a></div>
					</div>
					<p style="display: block; font-size: 14px;margin: 10px 0 0 10px">我的邀请码</p>
					<div class="cell-item">
							<!-- <p style="display: block">我的邀请链接</p> -->
							<div class="cell-left copylink1" id="codes"><%=inviteCode%></div>
							<div class="cell-right"><a href="javascript:;" class="btn btn-primary copyBtn1">复制</a></div>
						</div>
				</div>
				<img src="/images/contBg4.png" />

				<div class="m-grids-4">
						<a href="#" class="grids-item" style="width: 60px">
							<div class="grids-txt" ><span>序号</span></div>
						</a>
						<a href="#" class="grids-item">
							<div class="grids-txt"><span>微信名字</span></div>
						</a>
						<a href="#" class="grids-item" style="width:42%">
							<div class="grids-txt"><span>时间</span></div>
						</a>
						<a href="#" class="grids-item"  style="width:12%">
							<div class="grids-txt"><span>奖励</span></div>
						</a>
						<div class="tab">
							<p class="nodata">暂无数据</p>
						</div>
				</div>
				
	</section>	
	<div class="bottom_link">
			<img src="/images/contBg5.png" />
			<a href="http://www.carlive.io/iov/zh/" target="_blank" class="linktext">http://www.carlive.io/iov/zh/</a>
	</div>
</body>
<script>
	  /* 获取头部信息 */
	  function GetQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) {
            return r[2];
        }
    };
	var code = GetQueryString('code');
	var eth = GetQueryString('eth');
	var host =window.location.host;
	var codeslink =$("#codes").text();
	
	var hosts2= $("#linksad").text("http://"+host+'/invite?inviteCode='+codeslink);
	// console.log(host+'invite?inviteCode='+ codeslink);
 	// var starApplyTime = ($("#datetime").replace("T"," ").split("."))[0];

	var clipboard = new Clipboard('.copyBtn', { 
        target: function() {
			return document.querySelector('.copylink');
			layer.msg('复制成功')
        }
	});
	var clipboard2 = new Clipboard('.copyBtn1', { 
        target: function() {
            return document.querySelector('.copylink1');
        }
    });

    clipboard.on('success', function(e) {
		layer.msg('复制成功')
	});
	clipboard2.on('success', function(e) {
		layer.msg('复制成功')
	});
	

    clipboard.on('error', function(e) {
        layer.msg('复制失败')
	});
	
	
		!function (win, $) {
			$("#codes").text(code);
			// 请求
			$.ajax({
			url: '/users/invite/list',
			type: 'POST',
			data: {eth:eth},
			}).done(function (res) {
				if(res.data.length>0){
					if (res && res.code == 0) {
						listdata=res.data;
						var html ="";
						for(var i=0; i<listdata.length; i++){
							var num = i+1;
							html +="<div class='table_textnr'><a  class='grids-item' style='width: 60px'>"+
									"<div class='grids-txt'><span>"+ num + "</span></div>"+
									"</a>"+
									"<a  class='grids-item'>"+
									"<div class='grids-txt'><span>"+listdata[i].WECHAT_NAME+"</span></div>"+
									"</a>"+
									"<a  class='grids-item' style='width:42%'>"+
									"<div class='grids-txt' id='datetime'><span>"+(listdata[i].CREATE_TIME).replace("T"," ").split(".")[0]+"</span></div>"+
									"</a>"+
									"<a class='grids-item' style='width:12%'>"+
									"<div class='grids-txt'><span>"+listdata[i].AWARD_NUM+"</span></div>"+
									"</a></div>";
						}
						$(".tab").html('').append(html);
					}else {
					layer.msg(res.msg); 
				}
				}
			}).fail(function (res) { layer.msg("网络错误/服务器异常"); });
}(window, jQuery);
</script>
</html>